<style scoped>
	.swiper{
		position: relative;
		z-index: 1;
		top:0;
		height:25%;
		width: 100%;
	}
	.search{
		position: absolute;
    margin-top: 15px;
    width: 92%;
    margin-left: 4%;
	}
	.nav{
		position: relative;
	}
	.nav1,.nav2{
		position: relative;
		display: inline-block;
		width:50%;
		text-align: center;
	}
	input.nav1{
		position: absolute;
		top:0;
		left:0;
		z-index: 2;
		opacity: 0;
	}
	input.nav2{
		position: absolute;
		top:0;
		left:50%;
		z-index: 2;
		opacity: 0;
	}
	div.nav1,div.nav2{
		font-size: 16px;
		color:#7D7D7D;
	}
	#nav1,#nav2{
		display: none;
		padding-top: 20px;
	}
	input.nav1 ~ div.nav1,input.nav2 ~ div.nav2 {
		line-height: 44px;
	}
	input.nav1:checked ~ div.nav1,input.nav2:checked ~ div.nav2 {
		border-bottom:2px solid red;
		color:#FDAE56;
	}
	input.nav1:checked ~ div#nav1{
		display: block;
	}
	input.nav2:checked ~ div#nav2{
		display: block;
	}
	.publishbtn{
		background: #FD8C25;
    color: white;
    width: 100%;
    height: 64px;
    font-size: 24px;
    border:0;
	}
</style>
<style>
	html,body{
		height:100%;
		width:100%;
	}
	div,input,span{
		margin:0;
		padding:0;
	}
	input {
		border:0;
	}
</style>
<template>
	<div class="search">
		<search></search>
	</div>
	<div class="swiper">
		<swiper></swiper>
	</div>
	<div class="nav">
		<input type="radio" class="nav1" name="nav" checked="checked"><div class="nav1">最新发布</div><input type="radio" class="nav2" name="nav"><div class="nav2">即将出发</div>
		<div id="nav1">
			<activitieslist></activitieslist>
		</div>
		<div id="nav2">
			即将出发
		</div>
	</div>
	<button class="publishbtn" @click="sendactivity">发布活动</button>
</template>
<script type="text/javascript">
var search = require('../component/search.activities.vue');
var swiper = require('../component/swiper.vue');
var activitieslist = require('../component/activities.list.vue');
module.exports = {
	data:function(){
		return{
			activities:[]
		}
	},
	ready(){
		var jssdk = require('../utils/jssdk.js');
		jssdk(this);
		var vue = this;
		vue.$http.get('/camp/activity/getInfo').then(function(res){
			vue.activities = res.json();
			this.$broadcast("getActivities",vue.activities)
		},function(err){
			console.log(err)
		});
		vue.$http.get('/camp/getInfo').then(function(res){
			vue.activities = res.json();
			localStorage.setItem("places",JSON.stringify(vue.activities))
		},function(err){
			console.log(err)
		});
	},
	methods:{
		sendactivity:function(){
			this.$router.go({path:"/sendactivity"});
		}
	},
	components:{
		"search":search,
		"swiper":swiper,
		"activitieslist":activitieslist,
	}
}
</script>
